<div class="modal fade " id="columnInfoAddModal"   role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document" style="width: 60%">
        <div class="box box-info">
            <div class="box-header with-border">
                <h3 class="box-title">列信息</h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form class="form-horizontal" id="addExchangeInfoForm">
                <div class="box-body">
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">列名</label>
                        <div class="col-sm-7">
                            <input id="columnInfoAddModal_columnName" type="text" class="form-control" readonly="readonly">
                            <input id="columnInfoAddModal_id" type="hidden" >
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">名称</label>
                        <div class="col-sm-7">
                            <input id="columnInfoAddModal_name" type="text" class="form-control">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">类型</label>
                        <div class="col-sm-7">
                            <input id="columnInfoAddModal_dataType" type="text" class="form-control"  readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">是否为空</label>
                        <div class="col-sm-7">
                            <input id="columnInfoAddModal_nullAble" type="text" class="form-control"  readonly="readonly">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">说明</label>
                        <div class="col-sm-7">
                            <input id="columnInfoAddModal_remark" type="text" class="form-control">
                        </div>
                    </div>

                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"  >取消</button>

                    <button type="button" class="btn btn-primary pull-right" onclick="columnInfoAddModal_save()">保存</button>
                </div>
                <!-- /.box-footer -->
            </form>
        </div>
    </div>
</div>
<script>
    $(".select2").select2();

    function columnInfoAddModalInit() {
        $("#columnInfoAddModal_columnName").val("");
        $("#columnInfoAddModal_id").val("");
        $("#columnInfoAddModal_name").val("");
        $("#columnInfoAddModal_dataType").val("");
        $("#columnInfoAddModal_nullAble").val("");
        $("#columnInfoAddModal_remark").val("");

    }

    function columnInfoAddModalSetValue(index) {
        var data = $("#table2").bootstrapTable("getData")[index] ;
        $("#columnInfoAddModal_columnName").val(data.columnName);
        $("#columnInfoAddModal_id").val(data.id);
        $("#columnInfoAddModal_name").val(data.name);
        $("#columnInfoAddModal_dataType").val(data.dataType);
        $("#columnInfoAddModal_nullAble").val(data.nullAble);
        $("#columnInfoAddModal_remark").val(data.remark);
    }

    function columnInfoAddModal_save() {
        var data = {
            id:$("#columnInfoAddModal_id").val(),
            name:$("#columnInfoAddModal_name").val(),
            remark:$("#columnInfoAddModal_remark").val()
        };
        var url = "/databaseobject/detail/modify" ;
        postReq(url,data,function(result){
            if (result.success) {
                toastr['success']('操作成功', '提示');
                $("#table2").bootstrapTable("refresh");
                $("#columnInfoAddModal").modal("hide");
            } else {
                toastr['error'](result.msg, '提示');
            }
        }) ;

    }
</script>